package com.dao;

import java.util.List;

import org.hibernate.Session;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

/**
 * 鐢ㄤ簬杞ㄨ抗鐩稿叧鎺ュ彛瀹炵幇绫�
 * @author kevin
 */

public class ILocusDaoImpl  extends HibernateDaoSupport implements ILocusDao {
	
	/**
	 */
	public List findsubOrder(String[] l) {
		Session s = this.getHibernateTemplate().getSessionFactory().getCurrentSession();
		String sql ="select distinct(barcode),1 from  kex_Scan_SubOrder where subcode in (:id)  or barcode in (:id2)";
		//String updSql = " update kexekey.order_change_temp  set temp ='13' where order_number = 'RX104178681SG' ";
		//s.createSQLQuery(updSql).executeUpdate();
		return s.createSQLQuery(sql).setParameterList("id", l).setParameterList("id2", l).list();
	}
	
	/**
	 */
	public List findLocus(String id){
		Session s = this.getHibernateTemplate().getSessionFactory().getCurrentSession();
		String sql = "select * from kex_scan_select where barcode= ? order by scantime";
		return s.createSQLQuery(sql).setString(0,id).list();
	}
}
